﻿using System.Data;

namespace smp.QueryDb.Structure
{
    public class Id : Column
    {
        internal Id(Table table, string columnName, DbType dataType)
            :base(table, columnName, dataType)
        {
            IdGenerationType = IdGenerationType.ApplicationGenerated;
        }

        internal Id(Table table, string columnName, DbType dataType, bool isIdDataBaseGenerated)
            : base(table, columnName, dataType)
        {
            if(isIdDataBaseGenerated)
            {
                IdGenerationType = IdGenerationType.DatabaseGenerated;
            }
        }

        internal Id(Table table, string columnName, DbType dataType, IdGenerationType idGenerationType)
            : base(table, columnName, dataType)
        {
            IdGenerationType = idGenerationType;
        }

        internal IdGenerationType IdGenerationType { get; private set; }
    }
}
